# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-ziafont
pkgver=0.5
pkgrel=2
pkgdesc="Convert TTF/OTF font glyphs to SVG paths"
url="https://ziafont.readthedocs.io/"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-nbval' 'python-pytest-runner')
source=("$pkgname-$pkgver.tar.gz::https://bitbucket.org/cdelker/ziafont/get/$pkgver.tar.bz2")
sha512sums=('b7fd0aa1464396f38690d7df0059c1be74424ff0c91e3454dd88abcfe17a923ce6769b3dccaf45ab3dadf22110b02fb7a18c9a92c2c1076d50625b1047b933ff')

prepare() {
  mv cdelker-ziafont-* ziafont-$pkgver
}

build() {
  cd ziafont-$pkgver
  python setup.py build
}

check() {
  cd ziafont-$pkgver
  python setup.py pytest --addopts --nbval || echo "Tests failed"
}

package() {
  cd ziafont-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
